﻿@{
    var id = Model != null ? Model.ID : 0;
    ViewBag.Title = id > 0 ? "编辑承保公司" : "添加承保公司";
}
@using ZBJF.Warranty.BLL
@using ZBJF.Warranty.WebProvider
@model ZBJF.Warranty.Model.InsuranceCompany
<ul class="nav nav-tabs">
    <li><a href="/InsuranceCompany/">承保公司列表</a></li>
    <li class="active"><a href="/InsuranceCompany/Edit/@id">@( ViewBag.Title)</a></li>
</ul>
@using (Html.BeginForm("Save", "InsuranceCompany", FormMethod.Post, new { id = "mvcForm", name = "mvcForm", @class = "form-horizontal", enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.HiddenFor(c => c.ID)
    <div class="control-group">
        <label class="control-label">承保公司名称:</label>
        <div class="controls">
            @Html.TextBoxFor(m => m.CompanyName, new { validate = "{required:true,messages:{required:'请输入承保公司名称'}}" })
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">上级承保公司:</label>
        <div class="controls">
            @Html.DropDownListFor(m => m.ParentID, ConvertToSelector.Instance.InsuranceCompanyConvertToSelectList(true))
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">备注:</label>
        <div class="controls">
            @Html.TextBoxFor(m => m.Remark)
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">是否可用</label>
        <div class="controls">
            <label>
                @Html.CheckBoxFor(m => m.IsAvailable)
            </label>
        </div>
    </div>
    <div class="form-actions">
        <input id="btnSubmit" class="btn btn-primary Edit-R" type="submit" value="提交">
        <input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)">
    </div>
}
